package cn.ihuizi.entity;

import java.sql.Date;
import java.util.List;

import sun.launcher.LauncherHelper;

public class Role {
	int id;//角色id
	String name;//角色名称
	String gen_time;//角色生成时间
	String desc;//角色描述
	List<Role> role;
	String roleString;
	String power;
	public Role() {
		super();
	}
	
	public Role(int id) {
		super();
		this.id = id;
	}

	public Role(String name) {
		super();
		this.name = name;
	}
	
	public Role(int id, String name) {
		super();
		this.id = id;
		this.name = name;
	}
	
	
	public Role(String name, String power) {
		super();
		this.name = name;
		this.power = power;
	}

	public Role(int id, String name, List role) {
		super();
		this.id = id;
		this.name = name;
		this.role = role;
	}

	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getGen_time() {
		return gen_time;
	}
	public void setGen_time(String gen_time) {
		this.gen_time = gen_time;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}

	public List getRole() {
		return role;
	}

	public void setRole(List<Role> role) {
		this.role = role;
		String s = "";
		for(int i =0; i < role.size(); i++) {
			if(i == role.size()-1) s+=role.get(i).getName();
			else {
				s+=role.get(i).getName()+",";
				
			}
		}
		this.setRoleString(s);
	}

	public String getRoleString() {
		return roleString;
	}

	public void setRoleString(String roleString) {
		this.roleString = roleString;
	}

	public String getPower() {
		return power;
	}

	public void setPower(String power) {
		this.power = power;
	}

	@Override
	public String toString() {
		return "Role [id=" + id + ", name=" + name + ", gen_time=" + gen_time + ", desc=" + desc + ", role=" + role
				+ ", roleString=" + roleString + ", power=" + power + "]";
	}
	
	
}
